package com.sunwayworld.baseline.feishu.resource.impl;

import com.alibaba.fastjson.JSONObject;
import com.sunwayworld.baseline.feishu.resource.FeishuAuthCheck;
import com.sunwayworld.baseline.feishu.service.FeishuAuthCheckService;
import com.sunwayworld.framework.spring.annotation.GikamBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @ClassName FeishuAuthCheckImpl
 * @Author zhoujq
 * @Date 2022/8/4
 * @Version 1.0
 **/
@Controller
@GikamBean
public class FeishuAuthCheckImpl implements FeishuAuthCheck {

    @Autowired
    private FeishuAuthCheckService feishuAuthCheckService;

    public FeishuAuthCheckService getService() {
        return this.feishuAuthCheckService;
    }

    @Override
    public String feishuLoginCheck(String code, String state) {
        return getService().feishuLoginCheck(code, state);
    }

    @Override
    public String bindFeishuAccount(String code, String state) {
        return getService().bindFeishuAccount(code, state);
    }

    @Override
    @ResponseBody
    public JSONObject getFeishuLoginConfig() {
        return getService().getFeishuLoginConfig();
    }
}
